package io.renren.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.commons.mybatis.service.impl.CrudServiceImpl;
import io.renren.dao.AssemblyVoteDao;
import io.renren.dto.AssemblyVoteDTO;
import io.renren.entity.AssemblyVoteEntity;
import io.renren.service.AssemblyVoteService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 信息投票
 *
 * @author liuyujun 384880231@qq.com
 * @since 3.0 2022-01-13
 */
@Service
public class AssemblyVoteServiceImpl extends CrudServiceImpl<AssemblyVoteDao, AssemblyVoteEntity, AssemblyVoteDTO> implements AssemblyVoteService {

    @Override
    public QueryWrapper<AssemblyVoteEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<AssemblyVoteEntity> wrapper = new QueryWrapper<>();

        String title = (String)params.get("title");
        wrapper.like(StringUtils.isNotBlank(title), "title", title);

        return wrapper;
    }


}